/*
 * codeChecker.h
 *
 *  Created on: 2012-01-22
 *      Author: willion
 */

#ifndef CODECHECKER_H_
#define CODECHECKER_H_

class codeChecker {
public:
	//constructor, which takes a default bit error rate as 1%
	codeChecker(double errRate = 0.01);

	//check [blockSize] long block [blockNum] times
	//if the number of incorrect bits in any block is over the [threshold]
	//then return false, else return true
	bool check(int blockSize, int blockNum, int threshold = 2);

	//reset the bit error rate
	void setErrRate(double errRate);

	//return current errRate
	double getErrRate();

private:
	//bit error rate
	double errRate;

};

class codeChecker {
public:
	codeChecker();
	virtual ~codeChecker();
};

#endif /* CODECHECKER_H_ */
